﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Lesson6B : MonoBehaviour
{
    public int n = 1;
    // Start is called before the first frame update
    void Start()
    {
        for (int i = 0; i < n; i++)
        {
            Vector3 pos = new Vector3(i*-0.5f,i*-1f,i*0.5f);
            for (int j = 0; j < (i+1)*(i+1); j++)
            {
                GameObject obj = GameObject.CreatePrimitive(PrimitiveType.Cube);
                obj.transform.position = pos + new Vector3(j%(i+1)*1f,0f,j/(i+1)*-1f);
            }

        }
        
    }


}
